package top.maochang.hou.tools;


import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import top.maochang.hou.entity.SysUser;

public class UserContent {

    private static final String LOGINUSER="loginUser";

    public static void setUser(SysUser SysUser){
        Subject subject = SecurityUtils.getSubject();
        subject.getSession().setAttribute(LOGINUSER,SysUser);
    }

    public static Object getUser(){
        Subject subject = SecurityUtils.getSubject();
        SysUser attribute = (SysUser)subject.getSession().getAttribute(LOGINUSER);
        return attribute;
    }

}
